package binaryTree;

/**
 * 使用孩子表示法*/
public class BinaryTree {
    static class treeNode{
        public treeNode left;
        public treeNode right;
        public char val;
        public treeNode(char val) {
            this.left = null;
            this.right = null;
            this.val = val;
        }
    }
    public treeNode create() {
        //使用穷举的方式创建一棵树
        //完全二叉树
        treeNode A = new treeNode('A');
        treeNode B = new treeNode('B');
        treeNode C = new treeNode('C');
        treeNode D = new treeNode('D');
        treeNode E = new treeNode('E');
        treeNode F = new treeNode('F');
        treeNode G = new treeNode('G');
        treeNode H = new treeNode('H');
        A.left = B;
        A.right = C;
        B.left = D;
        B.right = E;
        C.left = F;
        C.right = G;
        D.left = H;
        return A;
    }
    //遍历方法
}
